<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2016/11/8 0008
 * Time: 上午 8:24
 */function checkUsername($username)
{
    if (!preg_match('/^[\w\x{4e00}-\x{9fa5}]{2,10}$/',$username)){
    }
    return true ;
}
function checkPassword($password){
    if (!preg_match('/^\w{6,16}$/',$password)){
        return '密码格式不符合要求';
    }
    return true;
}
function checkEmail($email){
    if(strlen($email) >40){
        return '邮箱长度不合法';
    }elseif (!preg_match('/^[a-z0-9]+@([a-z0-9]+\.)+[a-z]{2,4}$/i',$email)){
        return '邮箱格式不符合要求';
    }
    return true;
}

